User::IGNORE_USER_RIGHTS
);
}
- Hooks::run( 'UploadComplete', [ &$this ] );
+ // Avoid PHP 7.1 warning of passing $this by reference
+ $uploadBase = $this;
+ Hooks::run( 'UploadComplete', [ &$uploadBase ] );
$this->postProcessUpload();
}
'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
'http://www.w3.org/2000/svg',
'http://www.w3.org/tr/rec-rdf-syntax/',
+ 'http://www.w3.org/2000/01/rdf-schema#',
];
- if ( !in_array( $namespace, $validNamespaces ) ) {
+ // Inkscape mangles namespace definitions created by Adobe Illustrator.
+ // This is nasty but harmless. (T144827)
+ $isBuggyInkscape = preg_match( '/^&(#38;)*ns_[a-z_]+;$/', $namespace );
+
+ if ( !( $isBuggyInkscape || in_array( $namespace, $validNamespaces ) ) ) {
wfDebug( __METHOD__ . ": Non-svg namespace '$namespace' in uploaded file.\n" );
/** @todo Return a status object to a closure in XmlTypeCheck, for MW1.21+ */
$this->mSVGNSError = $namespace;
# fragment links are allowed. For all other tags, only data:
# and fragment are allowed.
if ( $stripped == 'href'
+ && $value !== ''
&& strpos( $value, 'data:' ) !== 0
&& strpos( $value, '#' ) !== 0
) {